<script type="text/javascript">
function show_this(hidden_div)
{
	$("#"+hidden_div).css({'visibility':'visible'});
}
function hide_this(hidden_div)
{
	$("#"+hidden_div).css({'visibility':'hidden'});
}
function bulk(param)
{
	var ids = $("input[name='konfirmasi_id[]']").serialize();
	var param;
	if (ids)
	{
		$.ajax({
			type: "POST",
			url: "<?php echo site_url().'backend/order_confirm/ajax_bulk_action/' ?>"+param,
			data: ids,
			success: function(data) {
				window.location.reload();
				$(":checkbox").removeAttr("checked");
			}
		});
	}
}
//jQuery
$(function(){
	$(".check_all").click(function(){
		var checked_status = this.checked;
		$(":checkbox").each(function()
		{
		this.checked = checked_status;
		});
	});
	setTimeout(function(){
	  $("#kotak").fadeOut("slow", function(){
		$("#kotak").remove();
	  });    
	}, 3000);
});
</script>
<style type="text/css">
      #kotak {
        width: 200px;
        height: 20px;
      }
</style>
<div class="left"></div>
<div class="right"></div>
<div class="heading">
	<h1 style="background-image: url('<?php echo base_url()?>assets/images/product.png');">Katalog</h1>
</div>
<div class="wrapper">
<h1>Konfirmasi Order</h1>
<div class="table_filter_wrapper">
	<input type="button" onclick="bulk('approve')" value="Approve">&nbsp;<input type="button" onclick="bulk('unapprove')" value="Unapprove">&nbsp;<input type="button" onclick="bulk('delete')" value="Delete">
</div>
<?php echo $this->session->flashdata('message_type');?>
<table>
	<thead>
		<tr>
			<th style="width:0%" ><input class="check_all" type="checkbox" ></th>
			<th style="width:0%" >No</th>
			<th style="width:10%">Code Order</th>
			<th style="width:10%">Tanggal</th>
			<th style="width:20%">Nama</th>
			<th style="width:15%">Bank Pengirim</th>
			<th style="width:15%">Bank Tujuan</th>
			<th style="width:15%">Jumlah</th>
			<th style="width:20%">Status</th>
		</tr>
	</thead>
	<?php
		$no = 1;
		foreach($content as $row):
	?>
	<tr class="<?php if ($no %2 == 0) echo 'even';?>">
		<td><input type="checkbox" name="konfirmasi_id[]" value="<?php echo $row['konfirmasi_id']?>"></td>
		<td><?php echo $no;?></td>
		<td onMouseOver="show_this('action-<?php echo $row["konfirmasi_id"]?>')" onMouseOut="hide_this('action-<?php echo $row["konfirmasi_id"]?>')">
			<b><?php echo anchor('backend/order_confirm/view/'.$row["konfirmasi_id"], get_order_data($row["order_id"])->order_code);?></b>
			<div id="action-<?php echo $row['konfirmasi_id']?>" class="action invisible">
				<?php echo anchor('backend/order_confirm/view/'.$row["konfirmasi_id"],'View')?> |
				<?php echo anchor('backend/order_confirm/delete/'.$row["konfirmasi_id"],'Delete',array('onclick' => "return confirm('Anda yakin menghapus kategori ini?')"))?>
			</div>
		</td>
		<td><?php echo formatDate($row["tgl_bayar"].' 00:00:00','short')?></td>
		<td><?php echo $row["nama"]?></td>
		<td><?php echo $row["bank_pengirim"]?></td>
		<td><?php echo get_bank_data($row["bank_tujuan_id"])->nama_bank?></td>
		<td><?php echo formatHarga($row["jumlah"],'lengkap')?></td>
		<td><strong><?php echo $row["status"]?></strong></td>
	</tr>
	<?php
	 	$no++;
		endforeach;
	?>
</table>
<?php if($this->pagination->create_links()==TRUE):?>
<p id="pagination">Halaman : <?php echo $this->pagination->create_links(); ?></p>
<?php endif; ?>
</div>
